﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Creating the FilmHelper.java Helper Class</title>
<meta name="GENERATOR" content="WinCHM">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

</head>

<body>
<P><SPAN 
style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px"> 
              
    . . The mapping files are XML files that contain data 
about how the columns in the tables are mapped to the fields in the POJOs. You 
need to have the<SPAN class=Apple-converted-space>&nbsp;</SPAN></SPAN><TT 
style="WORD-SPACING: 0px; FONT: 1.1em/18px 'Courier New', monospace; TEXT-TRANSFORM: none; COLOR: black; TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">hibernate.reveng.xml</TT><SPAN 
style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px"><SPAN 
class=Apple-converted-space>&nbsp;</SPAN>and<SPAN 
class=Apple-converted-space>&nbsp;</SPAN></SPAN><TT 
style="WORD-SPACING: 0px; FONT: 1.1em/18px 'Courier New', monospace; TEXT-TRANSFORM: none; COLOR: black; TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">hibernate.cfg.xml</TT><SPAN 
style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px"><SPAN 
class=Apple-converted-space>&nbsp;</SPAN>files to use the wizard.</SPAN></P>
<P><SPAN 
style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#000000 cellSpacing=0 
cellPadding=2 width="100%" border=1>
  
  <TR>
    <TD>&nbsp;<SPAN 
      style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">You 
      can use the Hibernate Mapping Files and POJOs from a Database wizard to 
      generate files for you</SPAN></TD>
    <TD>bạn có thể sử dụng Hibernate Mapping Files và POJOs từ Database Wizard 
      để generate những file cho bạn</TD></TR>
  <TR>
    <TD>&nbsp;<FONT color=#333333 size=2>The wizard can generate a POJO and a 
      <STRONG>corresponding </STRONG>   
            mapping file for each table that you 
      select in the wizard</FONT></TD>
    <TD>&nbsp;wizard có thể&nbsp;sinh ra&nbsp;một POJO và một 
      mapping file <STRONG>tương ứng </STRONG>cho mỗi table mà bạn chọn trong 
      wizard</TD></TR>
  <TR>
    <TD><SPAN 
      style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">To 
      create the POJOS and mapping files using a wizard, perform the following 
      steps :</SPAN></TD>
    <TD>để tạo ra POJOs và mapping files việc sử dụng một wizard, hãy thực thi 
      những bước sau : </TD></TR></TABLE></SPAN></P>
<P><IMG class="margin-around b-all" 
title="Generate Hibernate Mapping Files and POJOs wizard" 
alt="Generate Hibernate Mapping Files and POJOs wizard" 
src="http://netbeans.org/images_www/articles/71/web/hibernate-webapp/hibernate-pojo-wizard2.png" 
width=600></P>
<P>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#000000 cellSpacing=0 
cellPadding=2 width="100%" border=1>
  
  <TR>
    <TD>&nbsp;<SPAN 
style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">When 
you click Finish the IDE generates POJOs and Hibernate mapping files with the 
fields mapped to the columns specified in<SPAN 
class=Apple-converted-space>&nbsp;</SPAN></SPAN><TT 
style="WORD-SPACING: 0px; FONT: 1.1em/18px 'Courier New', monospace; TEXT-TRANSFORM: none; COLOR: black; TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">hibernate.reveng.xml</TT><SPAN 
style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">.</SPAN></TD>
    <TD><FONT face=Courier>khi&nbsp;bạn click Finish thì IDE sinh ra POJOs và 
      Hibernate mapping file với fields&nbsp;đã map&nbsp;để các 
      cột&nbsp;đã&nbsp;xác&nbsp;định trong <FONT 
      > <FONT 
      face="Courier New" size=4>hibernate.reveng.xml</FONT><SPAN 
style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">.</SPAN></FONT>     
                 
        
    </FONT></TD></TR>
  <TR>
    <TD>&nbsp;<FONT size=2><FONT color=#333333><FONT 
      face=Verdana> <FONT style="BACKGROUND-COLOR: #00ff00"> 
The IDE also adds mapping entries to<SPAN 
class=Apple-converted-space>&nbsp;</SPAN></FONT></FONT></FONT></FONT><FONT 
      style="BACKGROUND-COLOR: #00ff00"><TT 
style="WORD-SPACING: 0px; FONT: 1.1em/18px 'Courier New', monospace; TEXT-TRANSFORM: none; COLOR: black; TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px"><FONT 
      >hibernate.cfg.xml</FONT></TT><SPAN 
style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">.</SPAN></FONT></TD>
    <TD>&nbsp;<FONT style="BACKGROUND-COLOR: #00ff00">IDE cũng thêm mapping entries vào <FONT 
      face="Courier New" size=4 
      
      >hibernate.cfg.xml</FONT><SPAN 
style="DISPLAY: inline! important; FLOAT: none; WORD-SPACING: 0px; FONT: 11px/18px Verdana, 'Verdana CE', Arial, 'Arial CE', 'Lucida Grande CE', lucida, 'Helvetica CE', sans-serif; TEXT-TRANSFORM: none; COLOR: rgb(51,51,51); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-ALIGN: left; orphans: 2; widows: 2; webkit-text-size-adjust: auto; webkit-text-stroke-width: 0px">.</SPAN></FONT></TD></TR></TABLE><FONT 
face=Courier>&lt;hibernate-configuration&gt;<BR>&nbsp; 
&lt;session-factory&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;property 
name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;property 
name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;property 
name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3306/sakila&lt;/property&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;property 
name="hibernate.connection.username"&gt;myusername&lt;/property&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;property 
name="hibernate.connection.password"&gt;mypassword&lt;/property&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;property 
name="hibernate.show_sql"&gt;true&lt;/property&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;property 
name="hibernate.current_session_context_class"&gt;thread&lt;/property&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;property 
name="hibernate.query.factory_class"&gt;org.hibernate.hql.classic.ClassicQueryTranslatorFactory&lt;/property&gt;<BR><STRONG>&nbsp;&nbsp;&nbsp; 
&lt;mapping resource="dvdrental/FilmActor.hbm.xml"/&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;mapping resource="dvdrental/Language.hbm.xml"/&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;mapping resource="dvdrental/Film.hbm.xml"/&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;mapping resource="dvdrental/Category.hbm.xml"/&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;mapping resource="dvdrental/Actor.hbm.xml"/&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;mapping resource="dvdrental/FilmCategory.hbm.xml"/&gt;<BR></STRONG>&nbsp; 
&lt;/session-factory&gt;<BR>&lt;/hibernate-configuration&gt;</FONT></P></body>
</html>
